﻿#region License & Usage

//'Microsoft Public License (Ms-PL) 

//'This license governs use of the accompanying software. If you use the 
//'software, you accept this license. If you do not accept the license, do 
//'not use the software. 

//'1. Definitions 

//'The terms "reproduce," "reproduction," "derivative works," and 
//'"distribution" have the same meaning here as under U.S. copyright law. 

//'A "contribution" is the original software, or any additions or changes 
//'to the software. 

//'A "contributor" is any person that distributes its contribution under 
//'this license. 

//'"Licensed patents" are a contributor's patent claims that read directly 
//'on its contribution. 

//'2. Grant of Rights 

//'(A) Copyright Grant- Subject to the terms of this license, including the 
//'license conditions and limitations in section 3, each contributor grants 
//'you a non-exclusive, worldwide, royalty-free copyright license to 
//'reproduce its contribution, prepare derivative works of its 
//'contribution, and distribute its contribution or any derivative works 
//'that you create. 

//'(B) Patent Grant- Subject to the terms of this license, including the 
//'license conditions and limitations in section 3, each contributor grants 
//'you a non-exclusive, worldwide, royalty-free license under its licensed 
//'patents to make, have made, use, sell, offer for sale, import, and/or 
//'otherwise dispose of its contribution in the software or derivative 
//'works of the contribution in the software. 

//'3. Conditions and Limitations 

//'(A) No Trademark License- This license does not grant you rights to use 
//'any contributors' name, logo, or trademarks. 

//'(B) If you bring a patent claim against any contributor over patents 
//'that you claim are infringed by the software, your patent license from 
//'such contributor to the software ends automatically. 

//'(C) If you distribute any portion of the software, you must retain all 
//'copyright, patent, trademark, and attribution notices that are present 
//'in the software. 

//'(D) If you distribute any portion of the software in source code form, 
//'you may do so only under this license by including a complete copy of 
//'this license with your distribution. If you distribute any portion of 
//'the software in compiled or object code form, you may only do so under a 
//'license that complies with this license. 

//'(E) The software is licensed "as-is." You bear the risk of using it. The 
//'contributors give no express warranties, guarantees or conditions. You 
//'may have additional consumer rights under your local laws which this 
//'license cannot change. To the extent permitted under your local laws, 
//'the contributors exclude the implied warranties of merchantability, 
//'fitness for a particular purpose and non-infringement.

#endregion

#region Options

//

#endregion

#region Imports

//From .Net Framework 3.5
using Microsoft.Drawing;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using System.Reflection;
using System.Windows.Forms;

//From Custom Classes/Reference
using StedySoft.SenseSDK;
using StedySoft.SenseSDK.DrawingCE;
using SenseSDKExtended;
using SenseSDKExtended.DrawingCEEx;

#endregion

namespace SenseSDKExtendedDemoCSharp
{
    public partial class frm_main : Form
    {

        #region Fields

        //Declare header control to add on top of the form
        SenseHeaderControl s_header = new SenseHeaderControl();

        //Declare list control to add below the header control on the form
        SenseListControl s_list = new SenseListControl();

        //IImage icon_contact = SenseAPIs.SenseImage.LoadIImageFromFile(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase.Substring(0, System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase.LastIndexOf("\\")) + "\\Resources\\" + (Resolution.ScreenIsVGA ? "contact_vga" : "contact_qvga") + ".png");

        #endregion

        #region Methods

        private bool _isVGA()
        {
            return Resolution.ScreenIsVGA;
        }

        public frm_main()
        {
            InitializeComponent();
        }

        private void frm_main_Load(object sender, EventArgs e)
        {

            //Create header control properties
            s_header.Dock = System.Windows.Forms.DockStyle.Top;
            s_header.Location = new System.Drawing.Point(0, 0);
            s_header.Name = "s_header";
            s_header.Size = new System.Drawing.Size(240, 25);
            s_header.TabIndex = 0;
            s_header.Text = "SenseSDK Extended Demo";

            //Create list control properties.
            s_list.Dock = System.Windows.Forms.DockStyle.Fill;
            s_list.IsSecondaryScrollType = false;
            s_list.Location = new System.Drawing.Point(0, 200);
            s_list.MinimumMovement = 15;
            s_list.Name = "s_list";
            s_list.ShowScrollIndicator = false;
            s_list.TabIndex = 1;
            s_list.ThreadSleep = 100;
            s_list.TopIndex = 0;
            s_list.Velocity = 0.9F;
            s_list.Springback = 0.35F;

            //Add list control first on the form
            this.Controls.Add(s_list);

            //Add header control second on the form
            this.Controls.Add(s_header);

            //Sense list control beginupdates
            s_list.BeginUpdate();

            //Add header
            s_list.AddItem(new SensePanelDividerItem("custom_header", ""));

            //#################################  HeaderControlEx Style 1 - Examples  #################################

            SensePanelButtonItem btn_frm_SenseHeaderControlEx_HTCContactsStyle1_1 = new SensePanelButtonItem();
            btn_frm_SenseHeaderControlEx_HTCContactsStyle1_1.Text = "HeaderControlEx Style 1 - Example 1";
            btn_frm_SenseHeaderControlEx_HTCContactsStyle1_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SenseHeaderControlEx_HTCContactsStyle1_1_OnClick);
            s_list.AddItem(btn_frm_SenseHeaderControlEx_HTCContactsStyle1_1);

            SensePanelButtonItem btn_frm_SenseHeaderControlEx_HTCContactsStyle1_2 = new SensePanelButtonItem();
            btn_frm_SenseHeaderControlEx_HTCContactsStyle1_2.Text = "HeaderControlEx Style 1 - Example 2";
            btn_frm_SenseHeaderControlEx_HTCContactsStyle1_2.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SenseHeaderControlEx_HTCContactsStyle1_2_OnClick);
            s_list.AddItem(btn_frm_SenseHeaderControlEx_HTCContactsStyle1_2);

            SensePanelButtonItem btn_frm_SenseHeaderControlEx_HTCContactsStyle1_3 = new SensePanelButtonItem();
            btn_frm_SenseHeaderControlEx_HTCContactsStyle1_3.Text = "HeaderControlEx Style 1 - Example 3";
            btn_frm_SenseHeaderControlEx_HTCContactsStyle1_3.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SenseHeaderControlEx_HTCContactsStyle1_3_OnClick);
            s_list.AddItem(btn_frm_SenseHeaderControlEx_HTCContactsStyle1_3);

            //#################################  HeaderControlEx Style 2 - Examples  #################################

            SensePanelButtonItem btn_frm_SenseHeaderControlEx_HTCContactsStyle2_1 = new SensePanelButtonItem();
            btn_frm_SenseHeaderControlEx_HTCContactsStyle2_1.Text = "HeaderControlEx Style 2 - Example 1";
            btn_frm_SenseHeaderControlEx_HTCContactsStyle2_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SenseHeaderControlEx_HTCContactsStyle2_1_OnClick);
            s_list.AddItem(btn_frm_SenseHeaderControlEx_HTCContactsStyle2_1);

            SensePanelButtonItem btn_frm_SenseHeaderControlEx_HTCContactsStyle2_2 = new SensePanelButtonItem();
            btn_frm_SenseHeaderControlEx_HTCContactsStyle2_2.Text = "HeaderControlEx Style 2 - Example 2";
            btn_frm_SenseHeaderControlEx_HTCContactsStyle2_2.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SenseHeaderControlEx_HTCContactsStyle2_2_OnClick);
            s_list.AddItem(btn_frm_SenseHeaderControlEx_HTCContactsStyle2_2);

            SensePanelButtonItem btn_frm_SenseHeaderControlEx_HTCContactsStyle2_3 = new SensePanelButtonItem();
            btn_frm_SenseHeaderControlEx_HTCContactsStyle2_3.Text = "HeaderControlEx Style 2 - Example 3";
            btn_frm_SenseHeaderControlEx_HTCContactsStyle2_3.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SenseHeaderControlEx_HTCContactsStyle2_3_OnClick);
            s_list.AddItem(btn_frm_SenseHeaderControlEx_HTCContactsStyle2_3);

            //################################  SensePanelItemEx Style 1 - Examples  #################################

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle1_1 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle1_1.Text = "SensePanelItemEx Style 1 - Example 1";
            btn_frm_SensePanelItemEx_HTCContactsStyle1_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle1_1_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle1_1);

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle1_2 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle1_2.Text = "SensePanelItemEx Style 1 - Example 2";
            btn_frm_SensePanelItemEx_HTCContactsStyle1_2.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle1_2_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle1_2);

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle1_3 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle1_3.Text = "SensePanelItemEx Style 1 - Example 3";
            btn_frm_SensePanelItemEx_HTCContactsStyle1_3.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle1_3_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle1_3);

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle1_4 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle1_4.Text = "SensePanelItemEx Style 1 - Example 4";
            btn_frm_SensePanelItemEx_HTCContactsStyle1_4.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle1_4_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle1_4);

            //################################  SensePanelItemEx Style 2 - Examples  #################################

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle2_1 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle2_1.Text = "SensePanelItemEx Style 2 - Example 1";
            btn_frm_SensePanelItemEx_HTCContactsStyle2_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle2_1_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle2_1);

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle2_2 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle2_2.Text = "SensePanelItemEx Style 2 - Example 2";
            btn_frm_SensePanelItemEx_HTCContactsStyle2_2.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle2_2_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle2_2);

            //################################  SensePanelItemEx Style 3 - Examples  #################################

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle3_1 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle3_1.Text = "SensePanelItemEx Style 3 - Example 1";
            btn_frm_SensePanelItemEx_HTCContactsStyle3_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle3_1_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle3_1);

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle3_2 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle3_2.Text = "SensePanelItemEx Style 3 - Example 2";
            btn_frm_SensePanelItemEx_HTCContactsStyle3_2.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle3_2_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle3_2);

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle3_3 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle3_3.Text = "SensePanelItemEx Style 3 - Example 3";
            btn_frm_SensePanelItemEx_HTCContactsStyle3_3.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle3_3_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle3_3);

            //################################  SensePanelItemEx Style 4 - Examples  #################################

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle4_1 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle4_1.Text = "SensePanelItemEx Style 4 - Example 1";
            btn_frm_SensePanelItemEx_HTCContactsStyle4_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle4_1_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle4_1);

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle4_2 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle4_2.Text = "SensePanelItemEx Style 4 - Example 2";
            btn_frm_SensePanelItemEx_HTCContactsStyle4_2.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle4_2_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle4_2);

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle4_3 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle4_3.Text = "SensePanelItemEx Style 4 - Example 3";
            btn_frm_SensePanelItemEx_HTCContactsStyle4_3.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle4_3_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle4_3);

            SensePanelButtonItem btn_frm_SensePanelItemEx_HTCContactsStyle4_4 = new SensePanelButtonItem();
            btn_frm_SensePanelItemEx_HTCContactsStyle4_4.Text = "SensePanelItemEx Style 4 - Example 4";
            btn_frm_SensePanelItemEx_HTCContactsStyle4_4.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelItemEx_HTCContactsStyle4_4_OnClick);
            s_list.AddItem(btn_frm_SensePanelItemEx_HTCContactsStyle4_4);

            //############################  SensePanelNumericItemEx Style 1 - Examples  ##############################

            SensePanelButtonItem btn_frm_SensePanelNumericItemEx_HTC2DigitStyle1_1 = new SensePanelButtonItem();
            btn_frm_SensePanelNumericItemEx_HTC2DigitStyle1_1.Text = "SPanelNumericItemEx Style 1 - 2 Digit";
            btn_frm_SensePanelNumericItemEx_HTC2DigitStyle1_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelNumericItemEx_HTC2DigitStyle1_1_OnClick);
            s_list.AddItem(btn_frm_SensePanelNumericItemEx_HTC2DigitStyle1_1);

            //############################  SensePanelNumericItemEx Style 1 - Examples  ##############################

            SensePanelButtonItem btn_frm_SensePanelNumericItemEx_HTC3DigitStyle1_1 = new SensePanelButtonItem();
            btn_frm_SensePanelNumericItemEx_HTC3DigitStyle1_1.Text = "SPanelNumericItemEx Style 1 - 3 Digit";
            btn_frm_SensePanelNumericItemEx_HTC3DigitStyle1_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelNumericItemEx_HTC3DigitStyle1_1_OnClick);
            s_list.AddItem(btn_frm_SensePanelNumericItemEx_HTC3DigitStyle1_1);

            //############################  SensePanelLinkLabel - Examples  ##############################

            SensePanelButtonItem btn_frm_SensePanelLinkLabel_1 = new SensePanelButtonItem();
            btn_frm_SensePanelLinkLabel_1.Text = "SensePanelLinkLabel 1 - Example 1";
            btn_frm_SensePanelLinkLabel_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelLinkLabel_1_OnClick);
            s_list.AddItem(btn_frm_SensePanelLinkLabel_1);

            SensePanelButtonItem btn_frm_SensePanelLinkLabel_2 = new SensePanelButtonItem();
            btn_frm_SensePanelLinkLabel_2.Text = "SensePanelLinkLabel 1 - Example 2";
            btn_frm_SensePanelLinkLabel_2.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelLinkLabel_2_OnClick);
            s_list.AddItem(btn_frm_SensePanelLinkLabel_2);

            //############################  SensePanelPictureBox Style 1 - Examples  ##############################

            SensePanelButtonItem btn_frm_SensePanelPictureBox_1 = new SensePanelButtonItem();
            btn_frm_SensePanelPictureBox_1.Text = "SensePanelPictureBox Style 1 - Example 1";
            btn_frm_SensePanelPictureBox_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelPictureBox_1_OnClick);
            s_list.AddItem(btn_frm_SensePanelPictureBox_1);

            //############################  SenseInputBox - Examples  ##############################

            SensePanelButtonItem btn_SenseInputBox_1 = new SensePanelButtonItem();
            btn_SenseInputBox_1.Text = "Open Input Box - Example 1";
            btn_SenseInputBox_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_SenseInputBox_1_OnClick);
            s_list.AddItem(btn_SenseInputBox_1);

            SensePanelButtonItem btn_SenseInputBox_2 = new SensePanelButtonItem();
            btn_SenseInputBox_2.Text = "Open Input Box - Example 2";
            btn_SenseInputBox_2.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_SenseInputBox_2_OnClick);
            s_list.AddItem(btn_SenseInputBox_2);

            //#################################  SensePanelHistogram Style 1 - Examples  #################################

            SensePanelButtonItem btn_frm_SensePanelHistogram_Style1_1 = new SensePanelButtonItem();
            btn_frm_SensePanelHistogram_Style1_1.Text = "SPanelHistogram - Style 1 - Example 1";
            btn_frm_SensePanelHistogram_Style1_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_frm_SensePanelHistogram_Style1_1_OnClick);
            s_list.AddItem(btn_frm_SensePanelHistogram_Style1_1);

            //############################  SenseNumericBox - Examples  ##############################

            SensePanelButtonItem btn_SenseNumericBox_1 = new SensePanelButtonItem();
            btn_SenseNumericBox_1.Text = "SPanelHistogram - Style 1 - Example 1";
            btn_SenseNumericBox_1.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_SenseNumericBox_1_OnClick);
            s_list.AddItem(btn_SenseNumericBox_1);

            SensePanelButtonItem btn_SenseNumericBox_2 = new SensePanelButtonItem();
            btn_SenseNumericBox_2.Text = "SPanelHistogram - Style 2 - Example 1";
            btn_SenseNumericBox_2.OnClick += new SensePanelButtonItem.ClickEventHandler(btn_SenseNumericBox_2_OnClick);
            s_list.AddItem(btn_SenseNumericBox_2);

            //########################################################################################################

            //Add footer
            s_list.AddItem(new SensePanelDividerItem("custom_footer", ""));

            //End updates of sense list control
            s_list.EndUpdate();

        }

        void btn_frm_SenseHeaderControlEx_HTCContactsStyle1_1_OnClick(object Sender)
        {
            {
                frm_SenseHeaderControlEx_HTCContactsStyle1 f = new frm_SenseHeaderControlEx_HTCContactsStyle1();
                f.Tag = "btn_frm_SenseHeaderControlEx_HTCContactsStyle1_1";
                f.Show();
            }
        }

        void btn_frm_SenseHeaderControlEx_HTCContactsStyle1_2_OnClick(object Sender)
        {
            {
                frm_SenseHeaderControlEx_HTCContactsStyle1 f = new frm_SenseHeaderControlEx_HTCContactsStyle1();
                f.Tag = "btn_frm_SenseHeaderControlEx_HTCContactsStyle1_2";
                f.Show();
            }
        }

        void btn_frm_SenseHeaderControlEx_HTCContactsStyle1_3_OnClick(object Sender)
        {
            {
                frm_SenseHeaderControlEx_HTCContactsStyle1 f = new frm_SenseHeaderControlEx_HTCContactsStyle1();
                f.Tag = "btn_frm_SenseHeaderControlEx_HTCContactsStyle1_3";
                f.Show();
            }
        }

        void btn_frm_SenseHeaderControlEx_HTCContactsStyle2_1_OnClick(object Sender)
        {
            {
                frm_SenseHeaderControlEx_HTCContactsStyle2 f = new frm_SenseHeaderControlEx_HTCContactsStyle2();
                f.Tag = "btn_frm_SenseHeaderControlEx_HTCContactsStyle2_1";
                f.Show();
            }
        }

        void btn_frm_SenseHeaderControlEx_HTCContactsStyle2_2_OnClick(object Sender)
        {
            {
                frm_SenseHeaderControlEx_HTCContactsStyle2 f = new frm_SenseHeaderControlEx_HTCContactsStyle2();
                f.Tag = "btn_frm_SenseHeaderControlEx_HTCContactsStyle2_2";
                f.Show();
            }
        }

        void btn_frm_SenseHeaderControlEx_HTCContactsStyle2_3_OnClick(object Sender)
        {
            {
                frm_SenseHeaderControlEx_HTCContactsStyle2 f = new frm_SenseHeaderControlEx_HTCContactsStyle2();
                f.Tag = "btn_frm_SenseHeaderControlEx_HTCContactsStyle2_3";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle1_1_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle1 f = new frm_SensePanelItemEx_HTCContactsStyle1();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle1_1";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle1_2_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle1 f = new frm_SensePanelItemEx_HTCContactsStyle1();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle1_2";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle1_3_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle1 f = new frm_SensePanelItemEx_HTCContactsStyle1();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle1_3";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle1_4_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle1 f = new frm_SensePanelItemEx_HTCContactsStyle1();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle1_4";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle2_1_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle2 f = new frm_SensePanelItemEx_HTCContactsStyle2();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle2_1";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle2_2_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle2 f = new frm_SensePanelItemEx_HTCContactsStyle2();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle2_2";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle3_1_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle3 f = new frm_SensePanelItemEx_HTCContactsStyle3();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle3_1";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle3_2_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle3 f = new frm_SensePanelItemEx_HTCContactsStyle3();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle3_2";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle3_3_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle3 f = new frm_SensePanelItemEx_HTCContactsStyle3();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle3_3";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle4_1_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle4 f = new frm_SensePanelItemEx_HTCContactsStyle4();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle4_1";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle4_2_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle4 f = new frm_SensePanelItemEx_HTCContactsStyle4();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle4_2";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle4_3_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle4 f = new frm_SensePanelItemEx_HTCContactsStyle4();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle4_3";
                f.Show();
            }
        }

        void btn_frm_SensePanelItemEx_HTCContactsStyle4_4_OnClick(object Sender)
        {
            {
                frm_SensePanelItemEx_HTCContactsStyle4 f = new frm_SensePanelItemEx_HTCContactsStyle4();
                f.Tag = "btn_frm_SensePanelItemEx_HTCContactsStyle4_4";
                f.Show();
            }
        }

        void btn_frm_SensePanelNumericItemEx_HTC2DigitStyle1_1_OnClick(object Sender)
        {
            {
                frm_SensePanelNumericItemEx_HTC2DigitStyle1 f = new frm_SensePanelNumericItemEx_HTC2DigitStyle1();
                f.Tag = "btn_frm_SensePanelNumericItemEx_HTC2DigitStyle1_1";
                f.Show();
            }
        }

        void btn_frm_SensePanelNumericItemEx_HTC3DigitStyle1_1_OnClick(object Sender)
        {
            {
                frm_SensePanelNumericItemEx_HTC3DigitStyle1 f = new frm_SensePanelNumericItemEx_HTC3DigitStyle1();
                f.Tag = "btn_frm_SensePanelNumericItemEx_HTC3DigitStyle1_1";
                f.Show();
            }
        }

        void btn_frm_SensePanelLinkLabel_1_OnClick(object Sender)
        {
            {
                frm_SensePanelLinkLabel f = new frm_SensePanelLinkLabel();
                f.Tag = "btn_frm_SensePanelLinkLabel_1";
                f.Show();
            }
        }

        void btn_frm_SensePanelLinkLabel_2_OnClick(object Sender)
        {
            {
                frm_SensePanelLinkLabel f = new frm_SensePanelLinkLabel();
                f.Tag = "btn_frm_SensePanelLinkLabel_2";
                f.Show();
            }
        }

        void btn_frm_SensePanelPictureBox_1_OnClick(object Sender)
        {
            {
                frm_SensePanelPictureBox_Style1 f = new frm_SensePanelPictureBox_Style1();
                f.Tag = "btn_frm_SensePanelPictureBox_Style1_1";
                f.Show();
            }
        }

        void btn_SenseInputBox_1_OnClick(object Sender)
        {
            {
                string a = SenseSDKExtended.DrawingCEEx.SenseAPIsEx.SenseInputBox.HTCStyle1.InputBox("\"Your most unhappy customers are your greatest source of learning.\" Who said this?", "Answer this question.", "Bill Gates");
            }
        }

        void btn_SenseInputBox_2_OnClick(object Sender)
        {
            {
                string a = SenseSDKExtended.DrawingCEEx.SenseAPIsEx.SenseInputBox.HTCStyle2.InputBox("\"Your most unhappy customers are your greatest source of learning.\" Who said this?", "Answer this question.", "Bill Gates said this. It is very true. We should never forget it.");
            }
        }

        void btn_frm_SensePanelHistogram_Style1_1_OnClick(object Sender)
        {
            {
                frm_SensePanelHistogram_Style1 f = new frm_SensePanelHistogram_Style1();
                f.Tag = "btn_frm_SensePanelHistogram_Style1_1";
                f.Show();
            }
        }

        void btn_SenseNumericBox_1_OnClick(object Sender)
        {
            {
                int a = SenseSDKExtended.DrawingCEEx.SenseAPIsEx.SenseNumericBox.HTCStyle1.NumericBox("Select the number...", 0, 0, 99);
            }
        }

        void btn_SenseNumericBox_2_OnClick(object Sender)
        {
            {
                int a = SenseSDKExtended.DrawingCEEx.SenseAPIsEx.SenseNumericBox.HTCStyle2.NumericBox("Select the number...", 0, 0, 999);
            }
        }

        private void frm_main_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {

            //Clear the list control
            s_list.Clear();

        }

        private void frm_main_Closed(object sender, EventArgs e)
        {

            //Dispose list control and header control
            s_list.Dispose();
            s_header.Dispose();

        }

        #endregion

        private void mnuExit_Click(object sender, EventArgs e)
        {
            try
            {
                //Check if page is morepanelitem

                if (mnuExit.Text == "Back")
                {
                    s_list.ShowParent();
                }
                else
                {
                    //Exit applicaiton
                    this.Close();
                    Application.Exit();
                }
            }
            catch (Exception ex)
            {
                //Throw exception if any other error caught
                throw new Exception(ex.Message);
            }
        }


    }
}